package com.seari.service.impl;

import com.seari.entity.ArticleInfo;
import com.seari.mapper.ArticleInfoMapper;
import com.seari.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleInfoMapper articleMapper;

    @Override
    public int insert(List<ArticleInfo> articleList) throws Exception {
        if (articleList != null && articleList.size() > 0) {
            try {
                int i = articleMapper.delArticle(articleList.get(0));
                return articleMapper.insertArticle(articleList);
            } catch (Exception e) {
                e.printStackTrace();
            }


        }
        return -1;
    }

}
